/*
 * WeightTest.c
 *
 * Created: 17/05/2012 13:46:07
 *  Author: Dani
 */ 


#include <avr/io.h>
#define F_CPU 8000000
#include <util/delay.h>
#include <avr/interrupt.h>
#include "lcd162.h"
#include "weight_sensor.h"
#include "engine.h"
#include "switch.h"
#include "uart.h"
#include "calibration.h"

void DriversInit();
void Stop();

uint8_t product_number = 0;
uint8_t product_weight = 0;
uint8_t stop = 0;

int main(void)
{
	
	sei();
	DriversInit();
	
	LCDDispString("Welcome!");
	//_delay_ms(1000);
	LCDClear();
	
	CalibrationEnter();
	
	while (1)
	{
		ShowWeight();
	}
}

void DriversInit()
{
	EngineInit();
	LCDInit();
	SwitchInit();
	WeightSensorInit();
	UARTInit(9600,8);
}

ISR(S2)
{
	EngineControl(ENGINE5,SPEED_MAX);
}
